<?php 
namespace Home\Model;
use Think\Model;
class UserModel extends Model{
	protected $_validate = array(
//array(验证字段1,验证规则,错误提示,[验证条件,附加规则,验证时间]),
		array("username","require","用户名不能为空!","1","","3"),
		array("username","3,12","用户名字在3-9之间","1","length","3"),
		array("password","require","密码不能为空!","1","","3"),
		array("yzm","require","验证码不能为空!","1","","3"),
		array("repwd","password","俩次密码不一致!","1","confirm","3"),
		array("username","6,12","密码在3-9之间","1","length","3"),
		array("email","require","邮箱不能为空!","1","","3"),
		array("username","","用户名已经存在!","1","unique","3"),
		array("email","","邮箱已经存在!","1","unique","3"),
		array("email","email","邮箱格式不对","1","","3"),
		//callback验证调用函数是否为true和false
		
		);
	protected $_auto = array (
     // array(完成字段1,完成规则,[完成条件,附加规则]),
	 	array("reg_time","time",3,"function"),
	 	);
	
}